import service from '@/utils/request'
import { prefix } from '../common'

export const tableApi = {
	getColumnsByTableName: (tableName: string) => {
		return service.get(`${prefix}/sys/table/columns?tableName=${tableName}`)
	},
	generateCodeApi: (data: any) => {
		return service.post(`${prefix}/sys/table/generateCode`, data)
	},
	updateTableColumn: (data: any) => {
		return service.put(`${prefix}/sys/table/updateTableColumn`, data)
	},
	insertGentable: (data: any) => {
		return service.post(`${prefix}/sys/table/insertGentable`, data)
	},
	deleteGentable: (data: any) => {
		return service.delete(`${prefix}/sys/table/delete?genTable=${data}`)
	}
}
